﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Pyramid_Game
{
    public class Hint : GameScreen
    {
        #region Declarations

        Random rand = new Random();
        Texture2D hintTexture;
        Script hintScript;

        #endregion

        #region Load

        public Hint(int type)
        {
            switch(type)
            {
                case 0:
                    hintScript = new Script("0", 14, new Vector2(0, 400));
                    break;
                case 1:
                    hintScript = new Script("1", 14, new Vector2(0, 400));
                    break;
                case 2:
                    hintScript = new Script("2", 14, new Vector2(0, 400));
                    break;
                case 3:
                    hintScript = new Script("3", 14, new Vector2(0, 400));
                    break;
                case 4:
                    hintScript = new Script("4", 14, new Vector2(0, 400));
                    break;
                case 5:
                    hintScript = new Script("5", 14, new Vector2(0, 400));
                    break;
                case 6:
                    hintScript = new Script("6", 14, new Vector2(0, 400));
                    break;
                case 7:
                    hintScript = new Script("7", 14, new Vector2(0, 400));
                    break;
                case 8:
                    hintScript = new Script("8", 14, new Vector2(0, 400));
                    break;
                case 9:
                    hintScript = new Script("9", 14, new Vector2(0, 400));
                    break;
                case 10:
                    hintScript = new Script("10", 14, new Vector2(0, 400));
                    break;
                case 11:
                    hintScript = new Script("11", 14, new Vector2(0, 400));
                    break;
                case 12:
                    hintScript = new Script("12", 14, new Vector2(0, 400));
                    break;
                case 13:
                    hintScript = new Script("13", 14, new Vector2(0, 400));
                    break;
                case 14:
                    hintScript = new Script("14", 14, new Vector2(0, 400));
                    break;
                case 15:
                    hintScript = new Script("15", 14, new Vector2(0, 400));
                    break;
                case 16:
                    hintScript = new Script("16", 14, new Vector2(0, 400));
                    break;
                case 17:
                    hintScript = new Script("17", 14, new Vector2(0, 400));
                    break;
                case 18:
                    hintScript = new Script("18", 14, new Vector2(0, 400));
                    break;
                case 19:
                    hintScript = new Script("19", 14, new Vector2(0, 400));
                    break;
                case 20:
                    hintScript = new Script("20", 14, new Vector2(0, 400));
                    break;
                case 21:
                    hintScript = new Script("21", 14, new Vector2(0, 400));
                    break;
                case 22:
                    hintScript = new Script("22", 14, new Vector2(0, 400));
                    break;
                case 23:
                    hintScript = new Script("23", 14, new Vector2(0, 400));
                    break;
            }
        }

        public override void LoadContent(ContentManager content)
        {
            hintTexture = content.Load<Texture2D>("Texture/door/hint");
            screenManager.AddScreen(hintScript);
        }

        #endregion

        #region Update & Draw

        public override void Update(Touch touch, GameTime gameTime)
        {
            if ((int)hintScript.Position.X < -200)
            {
                //우측에서 나오도록 위치를 지정
                hintScript.Position = new Vector2(Game1.viewport.Width, 400);
            }

            hintScript.LeftMove(3);
        }

        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(hintTexture, new Vector2(0, 400), Color.White);
        }

        #endregion

        public override void  RemoveThis()
        {
            screenManager.RemoveScreen(this);
            screenManager.RemoveScreen(hintScript);
        }
    }
}